/*public class Test {

    private String ueserName;
    private String password;

    public String getUeserName() {
        return ueserName;
    }

    public void setUeserName(String ueserName) {
        this.ueserName = ueserName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void logInFo(String ueserName,String password){
        if (!this.ueserName.equals(ueserName)){
            System.out.println("用户名错误！");
            return;
        }
        if (!this.password.equals(password)){
            System.out.println("密码错误！");
            return;
        }

        System.out.println("登录成功！");
    }
}*/
public class Test {

    private String ueserName;
    private String password;

    public String getUeserName() {
        return ueserName;
    }

    public void setUeserName(String ueserName) {
        this.ueserName = ueserName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void logInFo(String ueserName,String password){
        if (!this.ueserName.equals(ueserName)){
            throw new UsernameException("用户名错误异常");
        }
        if (!this.password.equals(password)){
            throw  new PasswordException("密码错误异常");
        }

        System.out.println("登录成功！");
    }
}
